import { h } from 'vue'
import {
  CameraOutlined,
  CloudUploadOutlined,
  HomeOutlined,
  InfoCircleOutlined,
  UserOutlined
} from '@ant-design/icons-vue'
import ACCESS_ENUM from '@/access/accessEnum.ts'

const staticRoutes = [
  {
    path: '/',
    name: 'index',
    component: () => import('@/layouts/index.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          icon: HomeOutlined,
          title: '首页',
          access: ACCESS_ENUM.NOT_LOGIN,
          showMenu: true
        }
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('@/views/about/index.vue'),
        meta: {
          icon: InfoCircleOutlined,
          title: '关于我们',
          access: ACCESS_ENUM.NOT_LOGIN,
          showMenu: true
        }
      },
      {
        path: '/admin/user-manage',
        name: 'user-manage',
        component: () => import('@/views/user-manage/index.vue'),
        meta: {
          icon: UserOutlined,
          title: '用户管理',
          access: ACCESS_ENUM.ADMIN,
          showMenu: true
        }
      },
      {
        path: '/picture/add',
        name: 'pictureAdd',
        component: () => import('@/views/picture/add/index.vue'),
        meta: {
          icon: CloudUploadOutlined,
          title: '上传图片',
          access: ACCESS_ENUM.USER,
          showMenu: true
        }
      },
      {
        path: '/picture/manage',
        name: 'pictureMange',
        component: () => import('@/views/picture/manage/index.vue'),
        meta: {
          icon: CameraOutlined,
          title: '图片管理',
          access: ACCESS_ENUM.USER,
          showMenu: true
        }
      },
      {
        path: '/picture/detail',
        name: 'pictureDetail',
        component: () => import('@/views/picture/detail/index.vue'),
        meta: {
          icon: CameraOutlined,
          title: '图片详情',
          access: ACCESS_ENUM.USER,
          showMenu: false
        }
      },
      {
        path: '/picture/upload/batch',
        name: 'pictureUploadBatch',
        component: () => import('@/views/picture/batch-upload/index.vue'),
        meta: {
          icon: CameraOutlined,
          title: '批量上传',
          access: ACCESS_ENUM.ADMIN,
          showMenu: false
        }
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/auth/login/index.vue'),
    meta: {
      title: '登录',
      access: ACCESS_ENUM.NOT_LOGIN,
      showMenu: false
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/auth/register/index.vue'),
    meta: {
      title: '注册',
      access: ACCESS_ENUM.NOT_LOGIN,
      showMenu: false
    }
  }
]

export default staticRoutes
